import yaml
import InfoTracer
from selenium import webdriver

# 读取配置文件
with open("config.yaml", "r", encoding="utf-8") as file:
    config = yaml.safe_load(file)

# 使用配置
weapon_dict = config["weapon_dict"]
coordinates = config["coordinates"]
preferences = config["account_preferences"]


driver = webdriver.Chrome("./chromedriver-win64/chromedriver.exe")
url = "https://www.pxb7.com/buy/10302/1?keyword=&searchType=%E8%87%AA%E7%84%B6%E6%90%9C%E7%B4%A2"
driver.get(url)  # 不需要验证用户就可以查找
driver.maximize_window()
InfoTracer.random_sleep(3)  # 等待网页加载

InfoTracer.input_default_info(driver=driver, preferences=preferences, weapon_dict=weapon_dict, coordinate=coordinates)


# 已完成账号筛选工作

# 抓取并解析账号信息
ls = InfoTracer.extract_account_info(driver)
pr = InfoTracer.extract_account_price(driver)



